(0) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
monus(S(x'), S(x)) → monus(x', x)
gcd(x, y) → gcd[Ite](equal0(x, y), x, y)
equal0(a, b) → equal0[Ite](<(a, b), a, b)
The (relative) TRS S consists of the following rules:
<(S(x), S(y)) → <(x, y)
<(0, S(y)) → True
<(x, 0) → False
gcd[Ite](False, x, y) → gcd[False][Ite](<(x, y), x, y)
gcd[Ite](True, x, y) → x
gcd[False][Ite](False, x, y) → gcd(y, monus(y, x))
gcd[False][Ite](True, x, y) → gcd(monus(x, y), y)
equal0[Ite](False, a, b) → False
equal0[Ite](True, a, b) → equal0[True][Ite](<(b, a), a, b)
equal0[True][Ite](False, a, b) → False
equal0[True][Ite](True, a, b) → True
Rewrite Strategy: INNERMOST
(1) DecreasingLoopProof (EQUIVALENT transformation)
The following loop(s) give(s) rise to the lower bound Ω(n1):
The rewrite sequence
monus(S(x'), S(x)) →+ monus(x', x)
gives rise to a decreasing loop by considering the right hand sides subterm at position [].
The pumping substitution is [x' / S(x'), x / S(x)].
The result substitution is [ ].
(2) BOUNDS(n^1, INF)
(3) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(4) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
monus(S(x'), S(x)) → monus(x', x)
gcd(x, y) → gcd[Ite](equal0(x, y), x, y)
equal0(a, b) → equal0[Ite](<(a, b), a, b)
The (relative) TRS S consists of the following rules:
<(S(x), S(y)) → <(x, y)
<(0', S(y)) → True
<(x, 0') → False
gcd[Ite](False, x, y) → gcd[False][Ite](<(x, y), x, y)
gcd[Ite](True, x, y) → x
gcd[False][Ite](False, x, y) → gcd(y, monus(y, x))
gcd[False][Ite](True, x, y) → gcd(monus(x, y), y)
equal0[Ite](False, a, b) → False
equal0[Ite](True, a, b) → equal0[True][Ite](<(b, a), a, b)
equal0[True][Ite](False, a, b) → False
equal0[True][Ite](True, a, b) → True
Rewrite Strategy: INNERMOST
(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(6) Obligation:
Innermost TRS:
Rules:
monus(S(x'), S(x)) → monus(x', x)
gcd(x, y) → gcd[Ite](equal0(x, y), x, y)
equal0(a, b) → equal0[Ite](<(a, b), a, b)
<(S(x), S(y)) → <(x, y)
<(0', S(y)) → True
<(x, 0') → False
gcd[Ite](False, x, y) → gcd[False][Ite](<(x, y), x, y)
gcd[Ite](True, x, y) → x
gcd[False][Ite](False, x, y) → gcd(y, monus(y, x))
gcd[False][Ite](True, x, y) → gcd(monus(x, y), y)
equal0[Ite](False, a, b) → False
equal0[Ite](True, a, b) → equal0[True][Ite](<(b, a), a, b)
equal0[True][Ite](False, a, b) → False
equal0[True][Ite](True, a, b) → True
Types:
monus :: S:0' → S:0' → S:0'
S :: S:0' → S:0'
gcd :: S:0' → S:0' → S:0'
gcd[Ite] :: True:False → S:0' → S:0' → S:0'
equal0 :: S:0' → S:0' → True:False
equal0[Ite] :: True:False → S:0' → S:0' → True:False
< :: S:0' → S:0' → True:False
0' :: S:0'
True :: True:False
False :: True:False
gcd[False][Ite] :: True:False → S:0' → S:0' → S:0'
equal0[True][Ite] :: True:False → S:0' → S:0' → True:False
hole_S:0'1_1 :: S:0'
hole_True:False2_1 :: True:False
gen_S:0'3_1 :: Nat → S:0'
(7) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
monus,
gcd,
<They will be analysed ascendingly in the following order:
monus < gcd
< < gcd
(8) Obligation:
Innermost TRS:
Rules:
monus(
S(
x'),
S(
x)) →
monus(
x',
x)
gcd(
x,
y) →
gcd[Ite](
equal0(
x,
y),
x,
y)
equal0(
a,
b) →
equal0[Ite](
<(
a,
b),
a,
b)
<(
S(
x),
S(
y)) →
<(
x,
y)
<(
0',
S(
y)) →
True<(
x,
0') →
Falsegcd[Ite](
False,
x,
y) →
gcd[False][Ite](
<(
x,
y),
x,
y)
gcd[Ite](
True,
x,
y) →
xgcd[False][Ite](
False,
x,
y) →
gcd(
y,
monus(
y,
x))
gcd[False][Ite](
True,
x,
y) →
gcd(
monus(
x,
y),
y)
equal0[Ite](
False,
a,
b) →
Falseequal0[Ite](
True,
a,
b) →
equal0[True][Ite](
<(
b,
a),
a,
b)
equal0[True][Ite](
False,
a,
b) →
Falseequal0[True][Ite](
True,
a,
b) →
TrueTypes:
monus :: S:0' → S:0' → S:0'
S :: S:0' → S:0'
gcd :: S:0' → S:0' → S:0'
gcd[Ite] :: True:False → S:0' → S:0' → S:0'
equal0 :: S:0' → S:0' → True:False
equal0[Ite] :: True:False → S:0' → S:0' → True:False
< :: S:0' → S:0' → True:False
0' :: S:0'
True :: True:False
False :: True:False
gcd[False][Ite] :: True:False → S:0' → S:0' → S:0'
equal0[True][Ite] :: True:False → S:0' → S:0' → True:False
hole_S:0'1_1 :: S:0'
hole_True:False2_1 :: True:False
gen_S:0'3_1 :: Nat → S:0'
Generator Equations:
gen_S:0'3_1(0) ⇔ 0'
gen_S:0'3_1(+(x, 1)) ⇔ S(gen_S:0'3_1(x))
The following defined symbols remain to be analysed:
monus, gcd, <
They will be analysed ascendingly in the following order:
monus < gcd
< < gcd
(9) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol monus.
(10) Obligation:
Innermost TRS:
Rules:
monus(
S(
x'),
S(
x)) →
monus(
x',
x)
gcd(
x,
y) →
gcd[Ite](
equal0(
x,
y),
x,
y)
equal0(
a,
b) →
equal0[Ite](
<(
a,
b),
a,
b)
<(
S(
x),
S(
y)) →
<(
x,
y)
<(
0',
S(
y)) →
True<(
x,
0') →
Falsegcd[Ite](
False,
x,
y) →
gcd[False][Ite](
<(
x,
y),
x,
y)
gcd[Ite](
True,
x,
y) →
xgcd[False][Ite](
False,
x,
y) →
gcd(
y,
monus(
y,
x))
gcd[False][Ite](
True,
x,
y) →
gcd(
monus(
x,
y),
y)
equal0[Ite](
False,
a,
b) →
Falseequal0[Ite](
True,
a,
b) →
equal0[True][Ite](
<(
b,
a),
a,
b)
equal0[True][Ite](
False,
a,
b) →
Falseequal0[True][Ite](
True,
a,
b) →
TrueTypes:
monus :: S:0' → S:0' → S:0'
S :: S:0' → S:0'
gcd :: S:0' → S:0' → S:0'
gcd[Ite] :: True:False → S:0' → S:0' → S:0'
equal0 :: S:0' → S:0' → True:False
equal0[Ite] :: True:False → S:0' → S:0' → True:False
< :: S:0' → S:0' → True:False
0' :: S:0'
True :: True:False
False :: True:False
gcd[False][Ite] :: True:False → S:0' → S:0' → S:0'
equal0[True][Ite] :: True:False → S:0' → S:0' → True:False
hole_S:0'1_1 :: S:0'
hole_True:False2_1 :: True:False
gen_S:0'3_1 :: Nat → S:0'
Generator Equations:
gen_S:0'3_1(0) ⇔ 0'
gen_S:0'3_1(+(x, 1)) ⇔ S(gen_S:0'3_1(x))
The following defined symbols remain to be analysed:
<, gcd
They will be analysed ascendingly in the following order:
< < gcd
(11) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
<(
gen_S:0'3_1(
n252_1),
gen_S:0'3_1(
+(
1,
n252_1))) →
True, rt ∈ Ω(0)
Induction Base:
<(gen_S:0'3_1(0), gen_S:0'3_1(+(1, 0))) →RΩ(0)
True
Induction Step:
<(gen_S:0'3_1(+(n252_1, 1)), gen_S:0'3_1(+(1, +(n252_1, 1)))) →RΩ(0)
<(gen_S:0'3_1(n252_1), gen_S:0'3_1(+(1, n252_1))) →IH
True
We have rt ∈ Ω(1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n0).
(12) Complex Obligation (BEST)
(13) Obligation:
Innermost TRS:
Rules:
monus(
S(
x'),
S(
x)) →
monus(
x',
x)
gcd(
x,
y) →
gcd[Ite](
equal0(
x,
y),
x,
y)
equal0(
a,
b) →
equal0[Ite](
<(
a,
b),
a,
b)
<(
S(
x),
S(
y)) →
<(
x,
y)
<(
0',
S(
y)) →
True<(
x,
0') →
Falsegcd[Ite](
False,
x,
y) →
gcd[False][Ite](
<(
x,
y),
x,
y)
gcd[Ite](
True,
x,
y) →
xgcd[False][Ite](
False,
x,
y) →
gcd(
y,
monus(
y,
x))
gcd[False][Ite](
True,
x,
y) →
gcd(
monus(
x,
y),
y)
equal0[Ite](
False,
a,
b) →
Falseequal0[Ite](
True,
a,
b) →
equal0[True][Ite](
<(
b,
a),
a,
b)
equal0[True][Ite](
False,
a,
b) →
Falseequal0[True][Ite](
True,
a,
b) →
TrueTypes:
monus :: S:0' → S:0' → S:0'
S :: S:0' → S:0'
gcd :: S:0' → S:0' → S:0'
gcd[Ite] :: True:False → S:0' → S:0' → S:0'
equal0 :: S:0' → S:0' → True:False
equal0[Ite] :: True:False → S:0' → S:0' → True:False
< :: S:0' → S:0' → True:False
0' :: S:0'
True :: True:False
False :: True:False
gcd[False][Ite] :: True:False → S:0' → S:0' → S:0'
equal0[True][Ite] :: True:False → S:0' → S:0' → True:False
hole_S:0'1_1 :: S:0'
hole_True:False2_1 :: True:False
gen_S:0'3_1 :: Nat → S:0'
Lemmas:
<(gen_S:0'3_1(n252_1), gen_S:0'3_1(+(1, n252_1))) → True, rt ∈ Ω(0)
Generator Equations:
gen_S:0'3_1(0) ⇔ 0'
gen_S:0'3_1(+(x, 1)) ⇔ S(gen_S:0'3_1(x))
The following defined symbols remain to be analysed:
gcd
(14) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol gcd.
(15) Obligation:
Innermost TRS:
Rules:
monus(
S(
x'),
S(
x)) →
monus(
x',
x)
gcd(
x,
y) →
gcd[Ite](
equal0(
x,
y),
x,
y)
equal0(
a,
b) →
equal0[Ite](
<(
a,
b),
a,
b)
<(
S(
x),
S(
y)) →
<(
x,
y)
<(
0',
S(
y)) →
True<(
x,
0') →
Falsegcd[Ite](
False,
x,
y) →
gcd[False][Ite](
<(
x,
y),
x,
y)
gcd[Ite](
True,
x,
y) →
xgcd[False][Ite](
False,
x,
y) →
gcd(
y,
monus(
y,
x))
gcd[False][Ite](
True,
x,
y) →
gcd(
monus(
x,
y),
y)
equal0[Ite](
False,
a,
b) →
Falseequal0[Ite](
True,
a,
b) →
equal0[True][Ite](
<(
b,
a),
a,
b)
equal0[True][Ite](
False,
a,
b) →
Falseequal0[True][Ite](
True,
a,
b) →
TrueTypes:
monus :: S:0' → S:0' → S:0'
S :: S:0' → S:0'
gcd :: S:0' → S:0' → S:0'
gcd[Ite] :: True:False → S:0' → S:0' → S:0'
equal0 :: S:0' → S:0' → True:False
equal0[Ite] :: True:False → S:0' → S:0' → True:False
< :: S:0' → S:0' → True:False
0' :: S:0'
True :: True:False
False :: True:False
gcd[False][Ite] :: True:False → S:0' → S:0' → S:0'
equal0[True][Ite] :: True:False → S:0' → S:0' → True:False
hole_S:0'1_1 :: S:0'
hole_True:False2_1 :: True:False
gen_S:0'3_1 :: Nat → S:0'
Lemmas:
<(gen_S:0'3_1(n252_1), gen_S:0'3_1(+(1, n252_1))) → True, rt ∈ Ω(0)
Generator Equations:
gen_S:0'3_1(0) ⇔ 0'
gen_S:0'3_1(+(x, 1)) ⇔ S(gen_S:0'3_1(x))
No more defined symbols left to analyse.
(16) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(1) was proven with the following lemma:
<(gen_S:0'3_1(n252_1), gen_S:0'3_1(+(1, n252_1))) → True, rt ∈ Ω(0)
(17) BOUNDS(1, INF)
(18) Obligation:
Innermost TRS:
Rules:
monus(
S(
x'),
S(
x)) →
monus(
x',
x)
gcd(
x,
y) →
gcd[Ite](
equal0(
x,
y),
x,
y)
equal0(
a,
b) →
equal0[Ite](
<(
a,
b),
a,
b)
<(
S(
x),
S(
y)) →
<(
x,
y)
<(
0',
S(
y)) →
True<(
x,
0') →
Falsegcd[Ite](
False,
x,
y) →
gcd[False][Ite](
<(
x,
y),
x,
y)
gcd[Ite](
True,
x,
y) →
xgcd[False][Ite](
False,
x,
y) →
gcd(
y,
monus(
y,
x))
gcd[False][Ite](
True,
x,
y) →
gcd(
monus(
x,
y),
y)
equal0[Ite](
False,
a,
b) →
Falseequal0[Ite](
True,
a,
b) →
equal0[True][Ite](
<(
b,
a),
a,
b)
equal0[True][Ite](
False,
a,
b) →
Falseequal0[True][Ite](
True,
a,
b) →
TrueTypes:
monus :: S:0' → S:0' → S:0'
S :: S:0' → S:0'
gcd :: S:0' → S:0' → S:0'
gcd[Ite] :: True:False → S:0' → S:0' → S:0'
equal0 :: S:0' → S:0' → True:False
equal0[Ite] :: True:False → S:0' → S:0' → True:False
< :: S:0' → S:0' → True:False
0' :: S:0'
True :: True:False
False :: True:False
gcd[False][Ite] :: True:False → S:0' → S:0' → S:0'
equal0[True][Ite] :: True:False → S:0' → S:0' → True:False
hole_S:0'1_1 :: S:0'
hole_True:False2_1 :: True:False
gen_S:0'3_1 :: Nat → S:0'
Lemmas:
<(gen_S:0'3_1(n252_1), gen_S:0'3_1(+(1, n252_1))) → True, rt ∈ Ω(0)
Generator Equations:
gen_S:0'3_1(0) ⇔ 0'
gen_S:0'3_1(+(x, 1)) ⇔ S(gen_S:0'3_1(x))
No more defined symbols left to analyse.
(19) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(1) was proven with the following lemma:
<(gen_S:0'3_1(n252_1), gen_S:0'3_1(+(1, n252_1))) → True, rt ∈ Ω(0)
(20) BOUNDS(1, INF)